let content_l = document.querySelector('.content_l')
let totop = document.querySelector('#totop')
window.onscroll = function () {
    //得到元素距离页面右边距离
    let right = document.body.offsetWidth - content_l.offsetLeft - content_l.offsetWidth
    //pageYoffset看到页面距离整个页面的高
    if (pageYOffset > content_l.offsetTop - 100) {
        content_l.style.position = 'fixed'
        content_l.style.right = right + 'px'
        content_l.style.top = '100px'
        totop.style.display = 'inline-block'
    } else {
        content_l.style.position = ''
        totop.style.display = 'none'
    }
}